#define _CRT_SECURE_NO_WARNINGS 1

#include<stdio.h>

int S(int n)
{
	int i = 0;
	int sum = 0;
	for (i = 0; i < 5; i++)
	{
		int j = 0;
		int x = 0;
		for (j = 0; j <= i; j++)
		{
			x = x * 10 + n;
		}
		sum += x;
	}
	return sum;
}

int main()
{
	int n = 0;
	int sum = 0;
	scanf("%d", &n);
	sum = S(n);
	printf("%d", sum);
	return 0;
}